package com.burges.net.dataStream.codeRuler.transform.SingleDataStream

import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment, _}

/**
  * 创建人    BurgessLee 
  * 创建时间   2020/1/26 
  * 描述     Filter的使用
  */
object FilterFunctionDemo {

	def main(args: Array[String]): Unit = {
		val environment = StreamExecutionEnvironment.getExecutionEnvironment

		val dataStream = environment.fromElements(1,2,3,4,5,6)

		//通过通配符
		val filterStream: DataStream[Int] = dataStream.filter(_ % 2 == 0)
		//或指定运算表格式
		val filterStream02: DataStream[Int] = dataStream.filter(x => x % 2 ==0)

		filterStream.print()
		filterStream02.print()

		environment.execute("streaming FilterOperator")

	}

}
